from pydantic_settings import BaseSettings
from pydantic import ConfigDict
from dotenv import load_dotenv

class Settings(BaseSettings):
    
    db_host: str = "localhost"
    db_port: int = 3306
    db_user: str = "root"
    db_password: str = "Ai_edu2025"  # 添加默认空值，可以通过环境变量覆盖
    db_name: str = "ggb_gen"
    db_echo: bool = False  # 是否打印SQL语句
    
    # JWT Configuration
    jwt_secret_key: str = "your-secret-key-here-change-in-production"
    jwt_algorithm: str = "HS256"
    access_token_expire_minutes: int = 30
    refresh_token_expire_days: int = 7
    
    # LLM API Configuration
    version_api_key: str = "sk-3c1bd5cfaabb49c88750ba99b1ebf1e1"
    version_base_url: str = "https://maas.hikvision.com.cn/v1/chat/completions"
    version_model: str = "Qwen2.5-VL-72B-Instruct-1874024994729345025-test0319"
    
    thinking_api_key: str = "LanzOpenAI_9d9f1129-327c-456f-afc5-0818343b368c"
    thinking_base_url: str = "http://lanz.hikvision.com/v3/openai/deepseek-r1/v1"
    thinking_model: str = "DeepSeek-R1-0528"
    
    llm_base_url: str = "http://lanz.hikvision.com/v3/openai/deepseek-v3/v1"
    llm_model: str = "DeepSeek-V3-0324"
    llm_api_key: str = "LanzOpenAI_b65f6e11-ae53-4dcf-96c0-42daa3ae1b51"
    
    # Deepseek API Configuration for LLM APIs
    deepseek_api_key: str = "sk-9320e048d0d04f37a99eaa4d984bbe86"
    deepseek_base_url: str = "https://api.deepseek.com"
    deepseek_chat_model: str = "deepseek-chat"
    deepseek_reasoner_model: str = "deepseek-reasoner"
    deepseek_v3_model: str = "deepseek-chat"  # v3 模型使用 deepseek-chat
    
    # Screenshot Configuration
    screenshot_border_size: int = 3
    screenshot_border_color: str = "#FF5722"
    
    model_config = ConfigDict(extra="ignore", env_file=".env")

load_dotenv()
settings = Settings()
